package com.example.survey_determination.controller;

import com.example.survey_determination.service.CarDamageInfoService;
import entity.car_damage_info;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (CarDamageInfo)表控制层
 *
 * @author makejava
 * @since 2022-01-10 23:59:13
 */
@CrossOrigin(methods = {RequestMethod.GET,RequestMethod.POST})
@RestController
@RequestMapping("carDamageInfo")
public class CarDamageInfoController {
    /**
     * 服务对象
     */
    @Resource
    private CarDamageInfoService carDamageInfoService;



    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
    @RequestMapping("queryById")
    public car_damage_info queryById(String claimMainId) {
        return this.carDamageInfoService.queryById(claimMainId);
    }
    @RequestMapping("selectAll")
    public car_damage_info selectAll() {
        return this.carDamageInfoService.selectAll();
    }

    @RequestMapping("insert")
    public int insert(car_damage_info carDamageInfo) {
        return this.carDamageInfoService.insert(carDamageInfo);
    }
    /**
     * 删除数据
     *
     * @param id 主键
     * @return 删除是否成功
     */
    @DeleteMapping
    public ResponseEntity<Boolean> deleteById(Integer id) {
        return ResponseEntity.ok(this.carDamageInfoService.deleteById(id));
    }

}

